package com.qf.mvc2203.controller;

import com.qf.mvc2203.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/user")
public class UserController {
    //查询方法
    @RequestMapping("/selectAll")
    public String selectAll(List<User> users){
        return "/views/user.html";
    }
    //添加方法
    @RequestMapping("/add")
    public String addUser(User user){
        System.out.println("userAddUser..");
    return "redirect:/user/selectAll";
}
    //删除方法
    @RequestMapping("/del")
    public String deleteUser(Integer id){
        System.out.println("deleteUser..");
        return "redirect:/user/selectAll";
    }
}
